package leetcode;

//回文整数判断
public class IsPalindrome {
    public static void main(String[] args) {
        boolean palindrome = isPalindrome(323);
        System.out.println(palindrome);
    }
    public static boolean isPalindrome(int x) {
        if (x<0) return false;
        int target = x;
        long n =0; //翻转后的数
        while (x != 0){
            n = n*10 + x % 10;
            x = x/10;
        }
        if (n == target){
            return true;
        }else {
            return false;
        }
    }
}
